<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style type="text/css">
		img{
			width: 200px;
			height: 200px;
		}
	</style>
	<body>
		<div id="root">
			<p v-if="status==0"><img src="1.jpg" ></p>
			<p v-else><img src="2.jpg" ></p>
			<input type="submit" v-on:click="io" value="点我切换图片" />
		</div>
		<script type="text/javascript">
			new Vue({
				el:"#root",
				data:{
					status:0
				},
				methods:{
					io(){
						if (this.status==0) {
							this.status=1;
						} else{
							this.status=0;
						}
						
					}
				}
			})
		</script>
	</body>
</html>
